/**
 * JSP项目组版权所有
 */
package cn.com.change.dao.hibernate;

import java.util.ArrayList;
import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import cn.com.change.dao.BasedataDao;
import cn.com.change.model.School;

/**
 * @author cancer
 *
 */
public class BasedataDaoHibernate extends GenericDaoHibernate<School,Long> implements BasedataDao {

	
	public BasedataDaoHibernate() {
		super(School.class);
	}

	public School getSchool(Long id) {
		School school = new School();
		school = (School) getHibernateTemplate().find("from School where id = ?",id);
		return school;
	}
	
	
	@SuppressWarnings("unchecked")
	public List<School> getSchools(){
		List<School> schools = new ArrayList<School>();
		schools = getHibernateTemplate().find("from School");
		return schools;
	}

}
